<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box">盒子1</div>
    <div class="box">盒子2</div>
    <div id="nav"></div>
    <ul>
        <li>好久不减</li>
        <li>富士山下</li>
        <li>浮夸</li>
        <li>因为爱情</li>
    </ul>
    <script>
        // 1. getElementsByClassName 根据类名获得某些元素集合
        let boxs=document.getElementsByClassName('box')
        console.log(boxs);

        // 2. 返回符合条件的每一个元素 
        // let temp=document.querySelector('#nav')
        let temp=document.querySelector('.box')
        console.log(temp);

        // 3.返回数组
        let a=document.querySelectorAll('li');
        console.log(a);
    </script>
</body>
</html>